#include "thread_pool.hpp"
#include "Task.hpp"

#include <time.h>

int main()
{
    srand((long long)time(nullptr));
    MyThreadPool::ThreadPool<MyTask::Task> *tp = new MyThreadPool::ThreadPool<MyTask::Task>(10);
    tp->InitThreadPool();
    // 主线程
    const std::string ops = "+-*/%";
    while (true)
    {
        // 创建Task任务————t
        int x = rand() % 20 + 1;
        int y = rand() % 10 + 1;
        char op = ops[rand() % 5];
        MyTask::Task t(x, y, op);

        tp->PushTask(t);
        t.Show();
        sleep(1);
    }

    return 0;
}